package com.spring.annotation.config;

import com.spring.annotation.bean.Teacher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

@Configuration
public class SingletonConfig {

    @Bean
    @Lazy
    public Teacher singleton(){
        System.out.println("bean加入了ioc容器");
        return new Teacher();
    }

}
